<template>
  <div class="body2">
    <el-container style="height: 700px; xborder: 1px solid #eee">
      <el-aside width="200px">
        <el-menu text-color="#000000" active-text-color="#007575" router :default-active="this.$router.path"
          style="opacity: 0.7;font-weight:bold;height: 100%;font-family: '幼圆'">
          <div class="ziti">
            <el-image :src="logoUrl" style="width: 100px; height: 100px;opacity:1;" :fit="fit">
            </el-image>
          </div>
          <el-submenu index="1">
            <template slot="title">用户服务</template>
            <el-menu-item index="/userchat">在线客服</el-menu-item>
          </el-submenu>
        </el-menu>
      </el-aside>
      <el-container>
        <el-header height="30px">
          <span style="font-weight:bold;">欢迎登录卡尔汽车服务 用户界面 {{userInfoDto.userNickName}}&emsp;</span>
          <el-button type="info" plain @click="toUserlogin()">退出登录</el-button>
        </el-header>
        <el-main>
          <div style="margin-top: 50px;">
            <router-view />
          </div>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
  export default {
    name: "usermain",
    data() {
      return {
        headers: {},
        userInfoDto: { //用户信息
          userHeader: '', //角色名
          userNickName: '', //昵称
          userPhone: '', //电话
          userId:''
        },
        logoUrl: "https://aliyunfyl.oss-cn-chengdu.aliyuncs.com/carLogo.png",
        fit: "fill",
      };
    },
    methods: {
      toUserlogin() {
        this.$router.push("/userlogin")
      },
      //查个人信息
      loadAdmin() {
        this.$http.get("/person/userInfo/loadUserInfo").then(resp => {
          if (resp.data.code == 200) {
            this.userInfoDto = resp.data.data
          } else {}
        })
      },

    },
    created() {
      this.loadAdmin();
      this.headers["token"] = localStorage.getItem("token");
    }
  };
</script>

<style scoped>
  /* 在这里添加样式 */

  .el-header {
    position: relative;
    overflow: hidden;
    /* 防止模糊效果溢出*/
    line-height: 30px;
    text-align: right;
    border-bottom: 1px solid #eee;
    opacity: 0.7;
  }

  .el-main {
    position: relative;
    overflow: hidden;
    /* 防止模糊效果溢出*/
  }

  .ziti {
    font-size: 16px;
    font-family: '微软雅黑';
    color: white;
  }

  * {
    margin: 0px;
    padding: 0px;
  }

  .body2 {
    position: relative;
    overflow: hidden;
    /* 防止模糊效果溢出*/
  }

  .body2::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-image: url(https://aliyunfyl.oss-cn-chengdu.aliyuncs.com/backgroud1.jpg);
    background-size: cover;
    filter: blur(10px) brightness(1.2);
  }
</style>
